package com.hdhere.application.controller;

import com.hdhere.application.service.MediaService;
import com.hdhere.application.service.VideoService;
import com.hdhere.domain.common.Pagination;
import com.hdhere.domain.common.rest.CallResult;
import com.hdhere.domain.media.Video;
import com.hdhere.domain.media.page.VideoPagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by dus on 2018/11/4.
 */
@Api(tags = "视频文件")
@RestController
public class MediaController {

    @Autowired
    private MediaService mediaService;

    @Autowired
    private VideoService videoService;

    @ApiOperation(value = "获取薪资对象树")
    @GetMapping("/media/getList")
    public CallResult getObjectTree() {

        List<Video> list = mediaService.getList();
        return new CallResult(list);
    }

    @ApiOperation(value = "获取薪资对象树")
    @GetMapping("/media/getPage")
    public CallResult getPage() {

        VideoPagination input = new VideoPagination();
        //input.setCategoryId();
        Pagination page = videoService.getPage(input);
        return new CallResult(page);
    }
}
